﻿using MugenMvvmToolkit.Interfaces;
using MugenMvvmToolkit.Models;

namespace MugenMvvmToolkitTest.TestInfrastructure
{
    public class TestViewModelSettings : DefaultViewModelSettings
    {
        #region Properties

        public bool WithoutClone { get; set; }

        #endregion

        #region Overrides of DefaultViewModelSettings

        /// <summary>
        ///     Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        ///     A new object that is a copy of this instance.
        /// </returns>
        public override IViewModelSettings Clone()
        {
            if (WithoutClone)
                return this;
            return new TestViewModelSettings
            {
                DisposeCommands = DisposeCommands,                
                DisposeIocAdapter = DisposeIocAdapter,
                HandleBusyMessageMode = HandleBusyMessageMode,
#if !NONOTIFYDATAERROR
                ErrorsChangeExecutionMode = ErrorsChangeExecutionMode,
#endif
                DefaultBusyMessage = DefaultBusyMessage,                
                MetadataFactory = MetadataFactory
            };
        }

        #endregion
    }
}